/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/** *****************************************************************************************************
 *  \file     Fee_Types.h                                                                               *
 *  \brief    Semidrive. AUTOSAR 4.3.1 MCAL Flash EEPROM Emulation                                      *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2024/07/02     <td>1.0.0                               *
 * </table>                                                                                             *
 *******************************************************************************************************/
#ifndef FEE_TYPES_H
#define FEE_TYPES_H

#ifdef __cplusplus
extern "C" {
#endif

/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/
#include "Std_Types.h"
#include "MemIf_Types.h"
/* FLS Fls_AddressType & Fls_LengthType USED */
#include "Fls.h"

/********************************************************************************************************
 *                                 Global Macro definition                                              *
 *******************************************************************************************************/
#define FEE_PAGE_CFG_NUMBER                     2U

/********************************************************************************************************
 *                                  Global Types definition                                             *
 *******************************************************************************************************/
/* Fee block cfg */
typedef struct {
    uint16 blockNumber;                       /* Fee block number */
    uint16 blockSize;                         /* Size of Fee block */
    uint16 pageDevIndex;                      /* Fee page device Index */
    boolean immediateData;                         /* immediate data block flag */
} Fee_BlockConfigType;

/* Fee page cfg */
typedef struct {
    Fls_AddressType Fls_startAddr;              /* Fee page address */
    Fls_LengthType Fls_length;                  /* Fee page size */
    Fls_LengthType Fls_eraseSize;               /* Fee page erase size */
    Fls_LengthType Fls_sectorSize;              /* Fee page sector size */
} Fee_PageType;

/* Fee page device cfg */
typedef struct {
    const Fee_PageType *clrPtr;                       /* Fee page cfg */
    Fls_LengthType reservedSize;                /* Fee page reserved size */
} Fee_PageDeviceType;

typedef Fee_BlockConfigType Fee_ConfigType;

#ifdef __cplusplus
}
#endif

#endif /* FEE_TYPES_H */

/* End of file */
